EMT Practice Test

1. Question Content...


Question List

Question1: In a code review of a merchant's site you have discovered that there are multiple observers for the checkout_submit_all_after event. After closer inspection, you notice one of these observers is relying on the others being executed before it is called.
What risk does this pose, and how can it be mitigated?

Question2: What is the difference between online and offline shipping methods?

Question3: A merchant sells shoes with multiple variations such as a color and size. A shoe is represented by a configurable product. There are seven different colors and four sizes.
What is the minimal amount of simple products that represent a combination of color and size needs to be created in order to make a shoe salable?

Question4: In a custom module you are adding a new field to the store configuration. The field will set the value for the configuration path mycompany/mymodule/myoption.
How do you supply the default value for that configuration option?

Question5: How do you add a foreign key to an existing table created by another module?

Question6: What interface should a frontend controllers action implement?

Question7: You are creating a new page layout for your custom module.
What is the primary difference between container and block elements?

Question8: You have been asked to display details from the customer's latest order on the customer's account dashboard (customer/account/). You create a new custom template to show the information.
How do you obtain an order repository so you can fetch an order?

Question9: How do you instruct Magento to enable a new module?

Question10: A merchant tasks you to keep sales managers out of the system configuration backend pages.
How do you do that using the admin interface?

Question11: A custom module must make changes to the schema following each setup:upgrade run.
This must be done after all other module's schema updates have been applied.
How is this accomplished?

Question12: While reviewing a layout file named sales_order_view.xml you notice the element <update handle="customer_account"/>
What is the purpose of this element?

Question13: Which two ways does Magento persist category relationships in the database? (Choose two.)

Question14: A custom module is performing an optimized custom query for quote items.
The class applies the query customizations on the select object of a quote item collection instance.

You are tasked to resolve an issue where the query sometimes does not deliver the expected results. You have debugged the problem and found another class is also using a quote item collection and is loading the collection before the custom module.
How do you resolve the issue, keeping maintainability in mind?

Question15: A custom module needs to log all calls of \Magento\Customer\Api\AddressRepositoryInterface::save().
Which mechanism do you use?

Question16: You see this code in etc/adminhtml/routes.xml:
<route id="mymodule" frontName="user-subscriptions">
<module name="MyCompany_MyModule" />
</route> You have placed a controller in Controller/Index/Subscribe.php.
If you want to create layout XML instructions for this controller, what would be the layout XML's filename?

Question17: What happens when a category's is_anchor attribute is set to 1?

Question18: You are adding a new entry to the backend menu that appears after
Marketing > SEO & Search > Site Map
You see the existing site map menu item is declared by the node:

What two actions do you take to configure the new menu entry location? (Choose two.)

Question19: In layout files you can change al element's order on a page.
This can be done using one of the following:
* <move> instruction
* before and after element attributes?
How are two methods different?

Question20: You are adding an entry to the backend menu. To do so you open a core etc/adminhtml/menu.xml file as a reference.
In the file you see the node:

What is the result of specifying resource="Magento_Catalog::catalog"?

Question21: There are two different configurable products which both share one variation. The shared variation is represented by the same simple product.
A customer added both configurables to the cart with the same selected variation?
How will they be displayed?

Question22: You have created a module with a custom ACL resource and want to restrict access to resources of your module.
Which three items are restricted based on ACL role permissions? (Choose three.)

Question23: You have created a new product type, sample, and need to customize how it renders on the shopping cart page.
Keeping maintainability in mind, how do you add a new renderer?

Question24: The module MyCompany_MyModule will add a new page in the admin interface to display a custom entity in a grid.
You created a controller for this grid \MyCompany\MyModule\Controller\Adminhtml\CustomEntity\Index
Which two actions are required to make the new page accessible at the https://your.store.base.url/admin/my_module/custom_entity URL? (Choose two.)

Question25: You are implementing a before plugin in MyCompany_Magic. It will intercept the same method that MyCompany_Admission is already intercepting using a before plugin: Topmenu::getBlockHtml
Which two actions are required to ensure the new plugin will execute last? (Choose two.)

Question26: You want to remove a column introduced by a third-party extension via declarative schema.
How do you do that?

Question27: You need to add the Google Tag Manager (GTM) to every page.
What three steps do you take to accomplish this in MyCompany_MyModule?

Question28: There is a custom extension called MyCompany_MyModule.
It has the following layout customization declared in MyCompany/MyModule/view/frontend/layout/default.xml:
<referenceContainer name="content">
<block class="Magento\Framework\View\Element\Template"
name="my.block"
template="MyCompany_MyModule::my_template.phtml"
cacheable="false"/>
</referenceContainer>
What will be the result of the customization?

Question29: A merchant requires the ability to configure contact information for their brick and mortar stores as a CSV file upload. The module already exists and contains an etc/adminhtml/system.xml file where the new field can be added.
How do you specify the class that will process the uploaded file?

Question30: You are implementing a custom module MyModule, which provides an implementation of \Psr\Log\LoggerInterface called \MyCompany\MyModule\Logger.
The LoggerInterface has the default preference declared in app/etc/di.xml.
Keeping upgradability in mind, how do you make \MyCompany\MyModule\Logger the default implementation of the LoggerInterface globally?

Question31: While developing a module you need to modify an existing Data Patch.
How can you force Magento to execute an existing Data Patch file again?

Question32: What is the connection between product attribute sets and categories?

Question33: Magento 2's architecture uses code to bootstrap a custom module that resides in app/code.
What two files are required to make a module usable? (Choose two.)

Question34: You are working on a custom web API endpoint and have configured it in etc/webapi.xml.
This config is cached as part of the config_webservice cache type.
Keeping performance in mind, how do you refresh the cached version of this config using Magento CLI?

Question35: You need to add a new text attribute to all products in the Magento store. When this attribute is displayed on the product page, its values must be different depending on the selected language.
Keeping simplicity in mind, how do you add this attribute?

Question36: You are tasked with ensuring customers who log into the site are authorized. By default, this consists of ensuring the customers email and password match the values in the database. On this project, you need to verify additional data in this process.
Keeping in mind upgradeability, how is this done?

Question37: You added a plugin declaration to MyCompany/MyModule/etc/di.xml:

What will be the effect of this declaration?

Question38: You are creating a new indexer which must run after the targetrule_product_rule index process. When you run bin/magento indexer:reindex, your rule always runs first creating inaccurate data.
What is the resolution?

Question39: You have created a module to show manufacturer-list, but in your page need to show Pagination that already ready in your block. Keeping maintainability in mind, where you call echo $block->getPagerHtml();?

Question40: A merchant tasked you to add an input field for notes to the Customer Account Information backend page.
Which three actions do you specify in a module's Data Patch to add a customer notes attribute? (Choose three.)

Question41: How can you render a text on a page using only layout xml?

Question42: You have created a new section in system configuration under the Catalog tab:

How do you restrict an access to the section using Magento ACL?

Question43: A module you are developing requires the addition of new routes that should be accessible in the store front.
Where do you define your module's frontName?

Question44: You are updating a module to add extra functionality to the Magento application, Where would Magento look for modules?

Question45: How does Magento store customer address attribute values?

Question46: A merchant asks you to create a module that is able to process URLs with a custom structure that can contain any combination of a product type code, a partial name, and a 4-digit year in any order. The request path will look like this: /product/:type-code/:name-part/:year.
Which layer in the Magento request processing flow is suited for this kind of customization?

Question47: What is a valid use case for an around plugin?

Question48: You have created a module controller that responds to the following URL:
/mycompany/product/load/id/123.
Which two methods will load the product model by ID as specified in the URL? (Choose two.)

Question49: You have configured an event observer to watch the checkout_submit_all_after event using this XML:

What is the required class definition for the event observer?

Question50: \Magento\Sales\Model\Api\OrderRepositoryInterface::getList accepts a SearchCriteriaInterface to filter and sort information.
What class assists in creating an instance for SearchCriteriaInterface?

Question51: You are making some major adjustments to a core Magento class (ClassA). These adjustments are only necessary when utilized from a specific Magento class (ClassB). You have created MyClass that contains the needed customizations.
Keeping upgradeability in mind, how do you configure di.xml to make the substitution happen?

Question52: You are developing a new theme which inherits from the Magento_Luma theme.
How is this accomplished?